home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / interfac / it.dig / scripts / __Packages / mx / core / View.as < prev   
Encoding:
Text File  |  2011-06-09  |  3.8 KB  |  153 lines

  1. class mx.core.View extends mx.core.UIComponent
  2. {
  3.    var boundingBox_mc;
  4.    var border_mc;
  5.    var __tabIndex;
  6.    var depth;
  7.    var loadExternal;
  8.    var createClassChildAtDepth;
  9.    static var symbolName = "View";
  10.    static var symbolOwner = mx.core.View;
  11.    static var version = "2.0.2.127";
  12.    var className = "View";
  13.    static var childNameBase = "_child";
  14.    var hasBeenLayedOut = false;
  15.    var _loadExternalClass = "UIComponent";
  16.    function View()
  17.    {
  18.       super();
  19.    }
  20.    function init()
  21.    {
  22.       super.init();
  23.       this.tabChildren = true;
  24.       this.tabEnabled = false;
  25.       this.boundingBox_mc._visible = false;
  26.       this.boundingBox_mc._width = this.boundingBox_mc._height = 0;
  27.    }
  28.    function size()
  29.    {
  30.       this.border_mc.move(0,0);
  31.       this.border_mc.setSize(this.width,this.height);
  32.       this.doLayout();
  33.    }
  34.    function draw()
  35.    {
  36.       this.size();
  37.    }
  38.    function get numChildren()
  39.    {
  40.       var _loc3_ = mx.core.View.childNameBase;
  41.       var _loc2_ = 0;
  42.       while(true)
  43.       {
  44.          if(this[_loc3_ + _loc2_] == undefined)
  45.          {
  46.             return _loc2_;
  47.          }
  48.          _loc2_ = _loc2_ + 1;
  49.       }
  50.       return -1;
  51.    }
  52.    function get tabIndex()
  53.    {
  54.       return !this.tabEnabled ? undefined : this.__tabIndex;
  55.    }
  56.    function set tabIndex(n)
  57.    {
  58.       this.__tabIndex = n;
  59.    }
  60.    function addLayoutObject(object)
  61.    {
  62.    }
  63.    function createChild(className, instanceName, initProps)
  64.    {
  65.       if(this.depth == undefined)
  66.       {
  67.          this.depth = 1;
  68.       }
  69.       var _loc2_ = undefined;
  70.       if(typeof className == "string")
  71.       {
  72.          _loc2_ = this.createObject(className,instanceName,this.depth++,initProps);
  73.       }
  74.       else
  75.       {
  76.          _loc2_ = this.createClassObject(className,instanceName,this.depth++,initProps);
  77.       }
  78.       if(_loc2_ == undefined)
  79.       {
  80.          _loc2_ = this.loadExternal(className,this._loadExternalClass,instanceName,this.depth++,initProps);
  81.       }
  82.       else
  83.       {
  84.          this[mx.core.View.childNameBase + this.numChildren] = _loc2_;
  85.          _loc2_._complete = true;
  86.          this.childLoaded(_loc2_);
  87.       }
  88.       this.addLayoutObject(_loc2_);
  89.       return _loc2_;
  90.    }
  91.    function getChildAt(childIndex)
  92.    {
  93.       return this[mx.core.View.childNameBase + childIndex];
  94.    }
  95.    function destroyChildAt(childIndex)
  96.    {
  97.       if(!(childIndex >= 0 && childIndex < this.numChildren))
  98.       {
  99.          return undefined;
  100.       }
  101.       var _loc4_ = mx.core.View.childNameBase + childIndex;
  102.       var _loc6_ = this.numChildren;
  103.       var _loc3_ = undefined;
  104.       for(_loc3_ in this)
  105.       {
  106.          if(_loc3_ == _loc4_)
  107.          {
  108.             _loc4_ = "";
  109.             this.destroyObject(_loc3_);
  110.             break;
  111.          }
  112.       }
  113.       var _loc2_ = Number(childIndex);
  114.       while(_loc2_ < _loc6_ - 1)
  115.       {
  116.          this[mx.core.View.childNameBase + _loc2_] = this[mx.core.View.childNameBase + (_loc2_ + 1)];
  117.          _loc2_ = _loc2_ + 1;
  118.       }
  119.       delete this[mx.core.View.childNameBase + (_loc6_ - 1)];
  120.       this.depth = this.depth - 1;
  121.    }
  122.    function initLayout()
  123.    {
  124.       if(!this.hasBeenLayedOut)
  125.       {
  126.          this.doLayout();
  127.       }
  128.    }
  129.    function doLayout()
  130.    {
  131.       this.hasBeenLayedOut = true;
  132.    }
  133.    function createChildren()
  134.    {
  135.       if(this.border_mc == undefined)
  136.       {
  137.          this.border_mc = this.createClassChildAtDepth(_global.styles.rectBorderClass,mx.managers.DepthManager.kBottom,{styleName:this});
  138.       }
  139.       this.doLater(this,"initLayout");
  140.    }
  141.    function convertToUIObject(obj)
  142.    {
  143.    }
  144.    function childLoaded(obj)
  145.    {
  146.       this.convertToUIObject(obj);
  147.    }
  148.    static function extension()
  149.    {
  150.       mx.core.ExternalContent.enableExternalContent();
  151.    }
  152. }
  153.